package com.wn.icloud.provider.uac.rpc;

import com.wn.icloud.common.vo.log.LogInfo;
import com.wn.icloud.provider.uac.service.GateLogBiz;
import com.wn.icloud.provider.uac.entity.GateLog;
import com.wn.icloud.provider.uac.remote.LogFeignApi;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author leeyang
 * @create 2017-07-01 14:39
 */
@RequestMapping("/api")
@RestController
public class LogRest implements LogFeignApi {
    @Autowired
    private GateLogBiz gateLogBiz;

    @Override
    @PostMapping(value = "/log/save")
    public void saveLog(@RequestBody LogInfo info) {
        GateLog log = new GateLog();
        BeanUtils.copyProperties(info, log);
        gateLogBiz.insertSelective(log);
    }
}
